package metier.entite.user;

public enum TypeUser {
	ADMIN("admin"), 
	CLIENT("client") ;

	private final String text;

	private TypeUser(final String text) {
		this.text = text;
	}

	/* (non-Javadoc)
	 * @see java.lang.Enum#toString()
	 */
	@Override
	public String toString() {
		return text;
	}

	public static TypeUser fromString(String text) {
		if (text != null) {
			for (TypeUser b : TypeUser.values()) {
				if (text.equalsIgnoreCase(b.text)) {
					return b;
				}
			}
		}
		return null;
	}

}
